(function() {
	Path.on("/user/__basename__.html", function(_current_location) {
		App.set('title', '物流查询');
		var queryString = _current_location.query;
		var _id = queryString.get("id");
		var num = queryString.get('num');
		var com = queryString.get('com');
		App.set('$Cache.user.express.order_id', _id);
		App.set('$Cache.user.express.express_num', num);
		App.set('$Cache.user.express.com', com);
		if (!_id) {
			alert("warn", "订单号不可为空！！！");
			Path.jump("/user/order.html");
			return;
		};
		// if (num) {
		// 	coAjax.get(appConfig.server_url + "express_search", {
		// 		num: num,
		// 		company: com
		// 	}, function(result) {
		// 		console.log(result.result);
		// 		App.set("$Cache.user.express.express_data", result.result);
		// 	});
		// };
		// 这里开始是新的快递接口
		var Time = new Date();

		function check_num(_current_num) {
			if (_current_num < 10) {
				result_num = "0" + _current_num;
			} else {
				result_num = _current_num
			};
			return result_num;
		};
		var stmp = function() {
			var year = Time.getFullYear();
			var month = check_num((Time.getMonth() + 1));
			var day = check_num(Time.getDate());
			var hour = check_num(Time.getHours());
			var minutes = check_num(Time.getMinutes());
			var seconds = check_num(Time.getSeconds());
			return year + "" + month + "" + day + "" + hour + "" + minutes + "" + seconds;
		}();
		var auth = "&showapi_sign=59d749a067b2490dbeb7ffe9ab7fa1fd&showapi_appid=5635&showapi_timestamp=" + stmp;
		$.getJSON("https://route.showapi.com/64-17?comName=" + com + auth, function(result) {
			// console.log("comName", result);
			$.getJSON("http://route.showapi.com/64-19?com=" + result.showapi_res_body.com + "&nu=" + num + auth, function(result) {
				// console.log(result);
				App.set("$Cache.user.express.express_data", result.showapi_res_body);
			});
		});
	});
}());